import { FC } from "react"
import Taro, { useRouter } from '@tarojs/taro'
import success from '../../resource/success.png'
import style from './style.less'

const Success: FC = () => {
  const router = useRouter()
  Taro.setNavigationBarTitle({ title: router.params.title as string })
  return (
    <div className={style.root}>
      <img src={success} alt="" />
      <div className="success">{router.params.info}</div>
      <div className="back" onClick={() => {
        Taro.reLaunch({
          url: '/pages/index/index', success: () => {
            Taro.setStorageSync('refresh', true)
          }
        })
      }}>返回发货页面</div>
    </div>
  )
}

export default Success